<meta charset="UTF-8">

<div class="container-fluid">
	<div class="input-group col-md-4"
		style="float: left; padding: 0px 10px 20px 0px;">
		<span class="input-group-addon">请选择日期</span> 
		<input type="text" class="form-control" name="suspendTime" onchange="g_sy_fun(this.value)" placeholder="请选择日期" id="f_laydate" />
		<span class="glyphicon glyphicon-calendar form-control-feedback" style="margin-right: 10px;"></span>
	</div>
	
	<button type="button" class="btn btn-success" data-toggle="modal"  data-target="#myModal3" onclick="i_bk1()">补课</button>
</div>

<div class="container-fluid" id="g_sy_home"></div>

<script>
	$(function(){
		laydate.render({
			elem: '#f_laydate',
		  	calendar: true,    //开启公历节日,标明节日
		  	min:minDate()
		});
		var date = new Date();   //得到的不是常规格式
		//转为常规格式
		var d = date.toLocaleString();
		//获取当前年
		var year = date.getFullYear();
		//获取当前月
		var month = date.getMonth()+1;
		//获取当前日
		var day = date.getDate();
		//获取当前小时
		var hours = date.getHours();
		//获取当前分钟
		var minutes = date.getMinutes();
		//获取当前秒
		var seconds = date.getSeconds();
		if(month < 10){
			month = 0+""+month;
		}
		if(day < 10){
			day = 0+""+day;
		}
		var dat = year+"-"+month+"-"+day;   //当前日期
		
		laydate.render({
			elem: '#f_laydate',
		 	value: dat,
		 	calendar: true,    //开启公历节日,标明节日
		});
		
		var str = $("#f_laydate").val();
		g_sy_fun(str);
	});
	function minDate(){
	    var now = new Date();
	    return now.getFullYear()+"-" + (now.getMonth()+1) + "-" + now.getDate();
	}
	function g_sy_fun(str){
		$("#g_sy_home").load("ttb/g_give1?data="+str);
	}
	laydate.render({
		elem: '#f_laydate',
		min: minDate(),
		done:function(value){
			 $("#g_sy_home").load("ttb/g_give1?data="+value);
	    }
	});
</script>